﻿using System;
using System.Collections.Generic;
using Wamm.ApplicationExceptions;
using Wamm.Model.Abstract;
using Wamm.Model.Validation;

namespace Wamm.Model.Entities {
    public class Person : IEntity {
        // Gender values
        public static readonly string Male = "M";
        public static readonly string Female = "F";

        public int Id { get; set; }

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public string Gender { get; set; }

        public bool Guest { get; set; }

        public bool PrimaryContactForFamily { get; set; }

        public DateTime? BirthDate { get; set; }

        public int? FamilyId { get; set; }

        public virtual Family Family { get; set; }

        public virtual ICollection<PersonPhoto> PersonPhotos { get; set; }

        public bool Archived { get; set; }

        public string AddedBy { get; set; }

        public DateTime Added { get; set; }

        public string LastUpdatedBy { get; set; }

        public DateTime LastUpdated { get; set; }

        public void Validate(IList<RuleViolation> errors) {
            ValidatePerson.Validate(this, errors);
        }
    }
}
